Handle the case where there are no spaces or parameters
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 13:10:49 +0000 (14:10 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 13:10:49 +0000 (14:10 +0100)
after the image name on the command line.

Signed-off-by: Mike Day <mdday@us.ibm.com>
xen/arch/x86/setup.c

index f070b6303ef492e1b5ced4b47a89931b9d5c4104..5131250cbba663098af7abeb3dfa78edded207a9 100644 (file)
@@ -475,13 +475,14 @@ void __init __start_xen(multiboot_info_t *mbi)
     {
         static char dom0_cmdline[MAX_GUEST_CMDLINE];
 
-        /* Skip past the image name. */
+        /* Skip past the image name and copy to a local buffer. */
         while ( *cmdline == ' ' ) cmdline++;
         if ( (cmdline = strchr(cmdline, ' ')) != NULL )
+        {
             while ( *cmdline == ' ' ) cmdline++;
+            strcpy(dom0_cmdline, cmdline);
+        }
 
-        /* Copy the command line to a local buffer. */
-        strcpy(dom0_cmdline, cmdline);
         cmdline = dom0_cmdline;
 
         /* Append any extra parameters. */